﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NScheduler
{
    public class Log
    {
        /// <summary>
        /// 写错误日志
        /// </summary>
        /// <param name="e"></param>
        /// <param name="type"></param>
        public static void Error(Exception e)
        {
            log4net.ILog log = null;

            try
            {
                log = log4net.LogManager.GetLogger(Config.ErrorLogger);
            }
            catch
            {
                return;
            }

            var ex = e;
            if (e.InnerException != null)
                ex = e.InnerException;

            log.Error(ex.Message, ex);
        }
    }
}
